const Home = () => import('@/views/home') // @标签是在vue.config.js文件中定义的src路径的别名
const Category = () => import('@/views/category')
const SubCategory = () => import('@/views/category/subcategory')
// const List = () => import('@/views/list')
// const Mine = () => import('@/views/mine')
// const Cart = () => import('@/views/cart')
// const Detail = () => import('@/views/detail')
// const Confirm = () => import('@/views/confirm')
// const Login = () => import('@/views/login')
// const Register = () => import('@/views/register')
const footer = () => import('@/components/footerbar')
const header = () => import('@/components/headerbar')

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    components: {
      header,
      default: Home,
      footer
    },
    meta: {
      isfooter: true, // 判断是不是footer里面的内容
      title: '首页',
      icon: '' // 字体图标
    }
  },
  {
    path: '/category',
    name: 'Category',
    components: {
      header,
      default: Category,
      footer
    },
    meta: {
      isfooter: true,
      title: '分类',
      icon: '' // 字体图标
    },
    children: [
      {
        path: 'subcategory',
        name: 'SubCategory',
        component: SubCategory,
        meta: {}
      }
    ]
  }
]

export default routes
